#include "Random.h"

#include <cstdlib>
#include <ctime>

void vn::Random::initialize()
{
	srand(static_cast<unsigned int>(time(0)));
}

int vn::Random::getValue(int p_lowest, int p_highest)
{
	return std::rand() % p_highest + p_lowest;
}

float vn::Random::getValue(float p_lowest, float p_highest)
{
	return ((static_cast<float>(rand()) / static_cast<float>(RAND_MAX)) * (p_highest + p_lowest)) + p_lowest;
}

double vn::Random::getValue(double p_lowest, double p_highest)
{
	return ((static_cast<double>(rand()) / static_cast<double>(RAND_MAX)) * (p_highest + p_lowest)) + p_lowest;
}

float vn::Random::getPositiveValue(float p_lowest, float p_highest)
{
	return (static_cast<float>(rand()) / static_cast<float>(RAND_MAX)) * (p_highest + p_lowest);
}